define(['jquery','underscore','common'],function($,_,common){
var self;
var _this ={
	config:[
	     {url:'/get/categorys',name:'categorys'}
        ,{url:'/get/articles',name:'getArticles'}
	],
    init:function(){
       self = this;
       $.each(self.config,function(index,item){
           self[item.name] = function(data){
              var d = $.Deferred(); // 新建一个Deferred对象
              var opt = {};
              opt.d = d;
              opt.url = item.url;
              opt.type = item.type||'get';
              opt.data = data||{};
              opt.dataType = item.dataType||'json';
              common.ajax(opt);
              return d;
           };
       });
       return self;
    }   
};


  return _this.init();   
});